//Accpeted
#include <cstdio>
#include <cstring>

char s[2001];
int c, n, i, j;

void vai(int x){
	printf("%c", s[x]);
	if( ((x+c-1)<n) && (x%c) )vai(x+c-1);
}

int main(){
	//freopen("in.txt", "r", stdin);	freopen("out.txt", "w", stdout);
	scanf("%d", &c);
	while(c){
		scanf("%s", s);
		n=strlen(s);
		for(i=0;i<c;++i)vai(i);
		for(i+=(c-1);i<n;i+=c)vai(i);
		printf("\n");
		scanf("%d", &c);
	}
	
	return 0;
}
